import torch
import torch.nn as nn
import torch.optim as optim


class IMULSTMModel(nn.Module):
    def __init__(self, input_size, hidden_size, output_size, num_layers=1):
        super(IMULSTMModel, self).__init__()
        self.bn = nn.BatchNorm1d(input_size)
        self.lstm = nn.LSTM(input_size, hidden_size, num_layers, batch_first=True, bidirectional=True, dropout=0.2)
        self.fc = nn.Linear(hidden_size * 2, output_size)

    def forward(self, x):
        x = self.bn(x)

        lstm_out, _ = self.lstm(x)
        out = self.fc(lstm_out)
        return out